package com.example.study.controller;

import com.example.study.common.BeanConfig;
import com.example.study.service.UserReader;
import com.example.study.service.impl.UserReaderImpl1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {
    @Autowired
    private UserReaderImpl1 userReader;
    @Autowired
    private BeanConfig beanConfig;

    @GetMapping("/get")
    public String get(String id) {
        UserReader queryService = beanConfig.createQueryService(id);
        System.out.println(queryService.toString());
        return queryService.getUser();

    }
}
